home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / SHARED.Dxr / 00969_Gestion du Moteur de la Navig.ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  7.3 KB  |  240 lines

  1. on aide
  2.   global SprFondBar, SprFondBarII, CastEfface
  3.   PlayClick()
  4.   EffaceTexteRoll()
  5.   EffacePictRoll()
  6.   puppetSprite(42, 1)
  7.   set the castNum of sprite 42 to the number of cast "EcranAide"
  8.   set the castNum of sprite SprFondBar to the number of cast "N_BarretteAide"
  9.   set the castNum of sprite SprFondBarII to CastEfface
  10.   PuppetTransit(50, 1, 20, 1)
  11.   updateStage()
  12.   set Champs to "42  R_AideEnCours "
  13.   InitRollTexte(Champs)
  14.   SetDcBarrette(0)
  15.   SetDcRollOver(0)
  16. end
  17.  
  18. on ClicAide
  19.   PlayClick()
  20.   dontPassEvent()
  21.   FalseReste()
  22.   UnLoadReste()
  23.   InitNavig()
  24.   GoFrame("ResetNavig")
  25. end
  26.  
  27. on InitnavigBase
  28.   global DiskouCD
  29.   PlaySoundTest(2, "Puppet", "Hypernav3")
  30.   updateStage()
  31.   puppetTempo(60)
  32.   if DiskouCD = 0 then
  33.     InitNameCast()
  34.   end if
  35.   SetTransit("1 3")
  36. end
  37.  
  38. on InitNavig
  39.   InitBarrette("000")
  40.   InitRollNavigPlus()
  41.   InitanimOrigine()
  42. end
  43.  
  44. on InitRollNavigPlus
  45.   global listChampsNavig
  46.   set PistDepart to 10
  47.   set PistDepart to PistDepart - 1
  48.   set Champs to EMPTY
  49.   set Pz to 2
  50.   repeat with compt = 1 to getAt(listChampsNavig, 1)
  51.     set Champs to Champs & string(PistDepart + compt) & " "
  52.     set Champs to Champs & "C" & string(1 + getAt(listChampsNavig, Pz + 3)) & "_" & getAt(listChampsNavig, Pz) & " "
  53.     set Champs to Champs & "C3_" & getAt(listChampsNavig, Pz) & " "
  54.     set Champs to Champs & "R_Article" & " "
  55.     set Pz to Pz + 5
  56.   end repeat
  57.   InitRollGen(Champs)
  58.   set Champs2 to "8 LABOU1 LABOU2 R_Boutique 6 Abon_et Abon_al R_Abonnement"
  59.   AjouteRollGen(Champs2)
  60. end
  61.  
  62. on InitNameCast
  63.   global listChampsNavig
  64.   set CastDepart to the number of cast "RepereCastTV" + 1
  65.   set FrameDepart to the number of cast "RepereCastFrame" + 1
  66.   set Pz to 2
  67.   repeat with compt = 1 to getAt(listChampsNavig, 1)
  68.     set the name of cast CastDepart to "C1_" & getAt(listChampsNavig, Pz)
  69.     set the name of cast (CastDepart + 1) to "C2_" & getAt(listChampsNavig, Pz)
  70.     set the name of cast (CastDepart + 2) to "C3_" & getAt(listChampsNavig, Pz)
  71.     set CastDepart to CastDepart + 3
  72.     if getAt(listChampsNavig, Pz + 2) <> 0 then
  73.       set the name of cast FrameDepart to "F1_" & getAt(listChampsNavig, Pz)
  74.       set FrameDepart to FrameDepart + 1
  75.     end if
  76.     set Pz to Pz + 5
  77.   end repeat
  78. end
  79.  
  80. on InitDuCadre Piste, NumCast, PosAnim
  81.   global listChampsNavig
  82.   set SpriteFrame to 30
  83.   puppetSprite(SpriteFrame, 1)
  84.   set the locH of sprite SpriteFrame to the locH of sprite Piste
  85.   set the locV of sprite SpriteFrame to the locV of sprite Piste
  86.   set the castNum of sprite SpriteFrame to NumCast
  87.   updateStage()
  88.   set NbrLig to getAt(listChampsNavig, PosAnim + 2)
  89.   set Ycoeff to 19
  90.   set Xcoeff to 186
  91.   set SpriteFrameConsulte to 31
  92.   puppetSprite(SpriteFrameConsulte, 1)
  93.   set FrameConsulte to getAt(listChampsNavig, PosAnim + 4)
  94.   set CastFrameConsulte to the number of cast "N_FramesConsulte"
  95.   set Champs to EMPTY
  96.   repeat with AccuA = 1 to NbrLig
  97.     if char AccuA of FrameConsulte = "1" then
  98.       set Champs to Champs & " ‚Ä¢" & RETURN
  99.       next repeat
  100.     end if
  101.     set Champs to Champs & "  " & RETURN
  102.   end repeat
  103.   set the text of cast CastFrameConsulte to Champs
  104.   set the textHeight of cast CastFrameConsulte to Ycoeff
  105.   set the castNum of sprite SpriteFrameConsulte to CastFrameConsulte
  106.   set the locV of sprite SpriteFrameConsulte to the top of sprite SpriteFrame + 2
  107.   set the locH of sprite SpriteFrameConsulte to the right of sprite SpriteFrame - 165
  108.   set SpriteCadreFrame to 33
  109.   puppetSprite(SpriteCadreFrame, 1)
  110.   set the locH of sprite SpriteCadreFrame to the left of sprite SpriteFrame + 0
  111.   set the locV of sprite SpriteCadreFrame to the top of sprite SpriteFrame + 0
  112.   updateStage()
  113.   set Champs to "ClicSurCadre(1) R_Chapitre ClicSurCadre(2) R_Chapitre ClicSurCadre(3) R_Chapitre ClicSurCadre(4) R_Chapitre ClicSurCadre(5) R_Chapitre ClicSurCadre(6) R_Chapitre ClicSurCadre(7) R_Chapitre ClicSurCadre(8) R_Chapitre ClicSurCadre(9) R_Chapitre ClicSurCadre(10) R_Chapitre ClicSurCadre(11) R_Chapitre ClicSurCadre(12) R_Chapitre"
  114.   InitRollCadre(SpriteCadreFrame, "CadreFrame", 1, NbrLig, Xcoeff, Ycoeff, 0, 0, Champs)
  115. end
  116.  
  117. on AnnuleFrame
  118.   global CastEfface
  119.   set SpriteFrame to 30
  120.   set the castNum of sprite SpriteFrame to CastEfface
  121.   set SpriteFrameConsulte to 31
  122.   set the castNum of sprite SpriteFrameConsulte to -1
  123.   set SpriteCadreFrame to 33
  124.   set the castNum of sprite SpriteCadreFrame to CastEfface
  125.   SetDcRollCadre()
  126. end
  127.  
  128. on InitanimOrigine
  129.   global MemoNavPuce, listChampsNavig, CastEfface
  130.   set NumSprOrigine to 29
  131.   puppetSprite(NumSprOrigine, 1)
  132.   set AnimTV to word 1 of MemoNavPuce
  133.   set PosAnim to getOne(listChampsNavig, AnimTV)
  134.   if PosAnim = 0 then
  135.     set the castNum of sprite NumSprOrigine to CastEfface
  136.   else
  137.     set Piste to (PosAnim / 5) + 10
  138.     set the locH of sprite NumSprOrigine to the locH of sprite Piste
  139.     set the locV of sprite NumSprOrigine to the locV of sprite Piste
  140.     set the castNum of sprite NumSprOrigine to the number of cast "TVanimOrigin"
  141.     SetDcMacroVar("ClignAnimOrigine")
  142.   end if
  143. end
  144.  
  145. on ClignAnimOrigine
  146.   global CastEfface
  147.   if (the ticks / 30 mod 2) = 1 then
  148.     set the castNum of sprite 29 to the number of cast "TVanimOrigin"
  149.   else
  150.     set the castNum of sprite 29 to CastEfface
  151.   end if
  152. end
  153.  
  154. on ClicSurTV
  155.   PlayClick()
  156.   set NumDuCast to the mouseCast
  157.   ClicSurTVsuite(NumDuCast)
  158. end
  159.  
  160. on ClicSurTVsuite NumDuCast
  161.   global listChampsNavig
  162.   if NumDuCast = -1 then
  163.     return AnnuleFrame()
  164.   end if
  165.   set NomDuCast to the name of cast NumDuCast
  166.   set LenDuCast to length(NomDuCast)
  167.   if LenDuCast < 5 then
  168.     return AnnuleFrame()
  169.   end if
  170.   set NomAnim to chars(NomDuCast, 4, LenDuCast)
  171.   set PosAnim to getOne(listChampsNavig, NomAnim)
  172.   if PosAnim = 0 then
  173.     return AnnuleFrame()
  174.   end if
  175.   if getAt(listChampsNavig, PosAnim + 2) = 0 then
  176.     return DirectSurAnim(NomAnim)
  177.   end if
  178.   set Piste to RecupPisteClic(10, 24, NumDuCast)
  179.   set RepereClic to the bottom of sprite Piste - the mouseV
  180.   if RepereClic > 16 then
  181.     return DirectSurAnim(NomAnim)
  182.   end if
  183.   set SpriteFrame to 30
  184.   set NumCast to the number of cast ("F1_" & NomAnim)
  185.   if NumCast = the castNum of sprite SpriteFrame then
  186.     return DirectSurAnim(NomAnim)
  187.   end if
  188.   set NomMacro to "InitDuCadre(" & string(Piste) & "," & string(NumCast) & "," & string(PosAnim) & ")"
  189.   CallM(NomMacro)
  190. end
  191.  
  192. on DirectSurAnim NomAnim
  193.   global listRollCadre
  194.   if listRollCadre = list() then
  195.     return CallMpPara("GoMovie", ":" & NomAnim)
  196.   end if
  197.   CallM("AnnuleFrame")
  198. end
  199.  
  200. on ClicSurCadre Ligne
  201.   global listChampsNavig
  202.   PlayClick()
  203.   set SpriteFrame to 30
  204.   set NumDuCast to the castNum of sprite SpriteFrame
  205.   if NumDuCast = -1 then
  206.     return AnnuleFrame()
  207.   end if
  208.   set NomDuCast to the name of cast NumDuCast
  209.   set LenDuCast to length(NomDuCast)
  210.   if LenDuCast < 5 then
  211.     exit
  212.   end if
  213.   set NomAnim to chars(NomDuCast, 4, LenDuCast)
  214.   set PosAnim to getOne(listChampsNavig, NomAnim)
  215.   if PosAnim = 0 then
  216.     return AnnuleFrame()
  217.   end if
  218.   set listFrame to getAt(listChampsNavig, PosAnim + 1)
  219.   set NomAnim to ":" & getAt(listFrame, (Ligne * 2) - 1)
  220.   set NomFrame to getAt(listFrame, Ligne * 2)
  221.   CallMpPara("GoMovieRepere", NomAnim, NomFrame)
  222. end
  223.  
  224. on ClicSurFond
  225.   AnnuleFrame()
  226.   PlayClick()
  227. end
  228.  
  229. on ClicSurAnimOrigine
  230.   repeat with compt = 10 to 26
  231.     if rollOver(compt) then
  232.       set NumCast to the castNum of sprite compt
  233.       if NumCast > 0 then
  234.         set NomMacro to "ClicSurTVsuite(" & string(NumCast) & ")"
  235.         return CallM(NomMacro)
  236.       end if
  237.     end if
  238.   end repeat
  239. end
  240.